package com.effectivcrm.controller


import javax.validation.Valid;
import com.effectivcrm.domain.Opportunity
import com.effectivcrm.service.OpportunityService;

import org.codehaus.groovy.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/lov")
class ListOfValuesRestController {

	
	def salutation = ["Mr","Miss","Mrs"]
	def industry = ["Telecommunication","Mining","Chemical","Computer & IT","Electronics","Retail"]
	
	@RequestMapping(value = "/list/{viewName}", method=RequestMethod.GET )
	def list( @PathVariable String viewName){
		
		if("salutation".equals(viewName)){
			return salutation;
		}
		else if("industry".equals(viewName)){
			return industry;
		}
	}
	
	
}
